<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
	<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit">
    <title>首页</title>
    <link href="houtai/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="houtai/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
    <!-- Morris -->
    <link href="houtai/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
    <!-- Gritter -->
    <link href="houtai/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
    <link href="houtai/css/animate.css" rel="stylesheet">
    <link href="houtai/css/style.css?v=2.2.0" rel="stylesheet">
       <link href="houtai/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <style type="text/css">
        #first{
            border-left: none;
        }
        #ftime{
            float: right;
        }
    </style>
</head>
<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="houtai/img/profile_small.jpg" />
                             </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
                                <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">${sessionUsername}</strong>
                             </span>  <span class="text-muted text-xs block" >${sessionTitle}<b class="caret"></b></span> </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a href="form_avatar.html">修改头像</a>
                                </li>
                                <li><a href="profile.html">个人资料</a>
                                </li>
                                <li><a href="contacts.jsp">联系我们</a>
                                </li>
                                <li><a href="mailbox.html">信箱</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href="remove">安全退出</a>
                                </li>
                            </ul>
                        </div>
                        <div class="logo-element">
                           ${sessionUsername}
                        </div>

                    </li>
                    <li class="active" id="first">
                        <a href="index.do" style="border-left: 0px"><i class="fa fa-desktop"></i>主页 </a>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa fa-globe"></i> <span class="nav-label">文章管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getArticleList.do">文章列表</a>
                            </li>
                             <li><a href="getClassifyList.do">文章分类列表</a>
                            </li>
                        </ul>
                    </li>
                    
                    <li>
                        <a href="#"><i class="fa fa fa-globe"></i> <span class="nav-label">员工管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getCompanyList.do">公司</a>
                            </li>
                             <li><a href="getzhiweilist.do">职位列表</a>
                            </li>
                        </ul>
                     </li>
                       <li>
                        <a href="index.html#"><i class="fa fa fa-globe"></i> <span class="nav-label">投诉管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getTousuList.do">员工投诉列表</a>
                            </li>
                            <li><a href="getXuanjingTousuList.do">环境投诉列表</a>
                            </li>
                            <li><a href="getTousuClassifylist.do">投诉原因分类</a>
                            </li>
                        </ul>
                    </li>
                     <li>
                        <a href="#"><i class="fa fa-flask"></i> <span class="nav-label">管理员设置</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getMembersList.do">管理员列表</a>
                            </li>      
                        </ul>
                    </li>   
                      <li>
                        <a href="#"><i class="fa fa-flask"></i> <span class="nav-label">系统管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="authGroupList.do">角色管理</a>
                            </li>  
                              <li><a href="modulesList.do">模块管理</a>
                            </li>            
                        </ul>
                    </li>  
   
                    </ul>                        
            </div>
        </nav>

        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top"   style="margin-bottom: 0">
                    <div class="navbar-header">
                        <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                        <form   class="navbar-form-custom" method="post" action="search_results.html">
                            <div class="form-group">
                                <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search">
                            </div>
                        </form>
                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li>
                            <span class="m-r-sm text-muted welcome-message"><a href="index.html" title="返回首页"><i class="fa fa-home"></i></a>欢迎京斗云管理页面</span>
                        </li>
                        <li>
                            <a href="remove">
                                <i class="fa fa-sign-out"></i> 退出
                            </a>
                        </li>
                    </ul>

                </nav>
            </div>
             <div class="wrapper wrapper-content">
                <div class="row">
                    <div class="col-lg-3">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <span class="label label-danger pull-right">今天</span>
                                <h5>投诉数量</h5>
                            </div>
                            <div class="ibox-content">
                                <h1 class="no-margins todayCount" >0</h1>
                                <%--<div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i>--%>
                                </div>
                                <small>today</small>
                            </div>
                        </div>


                    <div class="col-lg-3">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <span class="label label-danger pull-right ">最近一周</span>
                                <h5>投诉数量</h5>
                            </div>
                            <div class="ibox-content">
                                <h1 class="no-margins weekCount">0</h1>
                                <%--<div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i>--%>
                            </div>
                            <small>7天</small>
                        </div>
                    </div>
                    <div class="col-lg-3">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <span class="label label-danger pull-right ">最近一个月</span>
                                <h5>投诉数量</h5>
                            </div>
                            <div class="ibox-content">
                                <h1 class="no-margins monthCount">0</h1>
                                <%--<div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i>--%>
                                </div>
                                <small>31</small>
                            </div>
                        </div>
                    <div class="col-lg-3">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <span class="label label-danger pull-right">全部</span>
                                <h5>投诉数量</h5>
                            </div>
                            <div class="ibox-content">
                                <h1 class="no-margins allCount">0</h1>
                                <%--<div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i>--%>
                            </div>
                            <small>all</small>
                        </div>
                    </div>
                    </div>
                 <div class="row">
                    <div class="col-lg-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>请选择时间段进行投诉查询</h5>
                                <span id="ftime">
                                    <input type="text"  class="laydate-icon span1-1 Calendar1" name="sTime" id="Calendar1" value="${sTime}" onClick="WdatePicker()"/>
                                    到
                                    <input type="text"  class="laydate-icon span1-1 Calendar2" name="eTime" id="Calendar2" value="${eTime}" onClick="WdatePicker({minDate:'#F{$dp.$D(\'Calendar1\')}'})"/>
                                    <input type="button" value="点击查询" class="btn btn-danger" onclick="kk()"/>
                                </span>
                            </div>
                            <div class="ibox-content">
                                <div class="echarts" id="echarts-pie-chart"></div>
                            </div>
                        </div>
                  </div>
            </div>
            <div class="footer">
                <div class="pull-right">
                    By：<a href="http://www.zi-han.net" target="_blank">zihan's blog</a>
                </div>
                <div>
                    <strong>Copyright</strong> H+ &copy; 2014
                </div>
            </div>
        </div>
    </div>

    <!-- Mainly scripts -->
    <script type="text/javascript" src="houtai/Jquery/jquery-3.0.0.js"></script>
    <script>
        $(function () {
            $.ajax({
                type : "get",
                url :  "getMouthCount",
                data: {},
                dataType: 'json',
                success:function (Result) {
                    var result = Result.result;
                    if(result==1){
                        $('.monthCount').html(Result.data+"个");
                    }
                }
            });

            $.ajax({
                type : "get",
                url :  "getweekCount",
                data: {},
                dataType: 'json',
                success:function (Result) {
                    var result = Result.result;
                    if(result==1){
                        $('.weekCount').html(Result.data+"个");
                    }
                }
            });

            $.ajax({
                type : "get",
                url :  "gettodayCount",
                data: {},
                dataType: 'json',
                success:function (Result) {
                    var result = Result.result;
                    if(result==1){
                        $('.todayCount').html(Result.data+"个");
                    }
                }
            });
            $.ajax({
                type : "get",
                url :  "getallCount",
                data: {},
                dataType: 'json',
                success:function (Result) {
                    var result = Result.result;
                    if(result==1){
                        $('.allCount').html(Result.data+"个");
                    }
                }
            });
            })
    </script>
    <script>
        var staffCounts="";
        var arrays = new Array();
        var arrays2 = new Array();
        var startTime=null;
        var endTime=null;
        $(function() {
            getArrays(startTime,endTime);


        })
        //条件查询
        function kk() {
            startTime=$('.Calendar1').val();
            endTime=$('.Calendar2').val();
            getArrays(startTime,endTime);
        }
        //加载数据
        function getArrays(startTime,endTime){
            arrays = [];
            $.ajax({
                type : "POST",
                url :  "getstaffCountlist",
                data: {sTime:startTime,eTime:endTime},
                dataType: 'json',
                async:false,
                success:function (Result) {
                    staffCounts=Result.data;

                }
            });
            for(var i=0;i<staffCounts.length;i++){
                arrays.push(staffCounts[i].staffName)
            }
            for(var i=0;i<staffCounts.length;i++){
                arrays2[i]={
                    value:staffCounts[i].tousuCount,
                    name:staffCounts[i].staffName
                }
            }
            //进去加载数据
            innert(arrays,arrays2);
        }
        function innert(arrays,arrays2){
            var pieChart = echarts.init(document.getElementById("echarts-pie-chart"));
            var pieoption = {
                title : {
                    text: '统计员工被投诉次数',
                    subtext: '实时数据',
                    x:'center'
                },
                tooltip : {
                    trigger: 'item',
                    formatter: "{a} <br/>{b} : {c} ({d}%)"
                },
                legend: {
                    orient : 'vertical',
                    x : 'right',
                    data:arrays
                },
                calculable : true,//外部虚框
                series : [
                    {
                        name:'投诉比例',
                        type:'pie',
                        radius : '55%',
                        center: ['50%', '60%'],
                        data:arrays2
                    }
                ]
            };
            pieChart.setOption(pieoption);
        }
    </script>
    <script src="houtai/js/bootstrap.min.js?v=3.4.0"></script>
    <script src="houtai/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="houtai/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="houtai/My97DatePicker/My97DatePicker/WdatePicker.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="houtai/js/hplus.js?v=2.2.0"></script>
    <script src="houtai/js/plugins/pace/pace.min.js"></script>


    <!-- ECharts -->
    <script src="houtai/js/plugins/echarts/echarts-all.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="houtai/js/hplus.js?v=2.2.0"></script>
    <script src="houtai/js/plugins/pace/pace.min.js"></script>

    <!-- ECharts demo data -->
    <script src="houtai/js/demo/echarts-demo.js"></script>

    
    
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script><!--统计代码，可删除-->
   
</body>

</html>